//
// Created by jwhww on 25-11-11.
//

#ifndef REMOTE_CRTL_H
#define REMOTE_CRTL_H

// 弧度转编码器值系数
static const float RADIAN_TO_ENCODER_K = 8192.f / (2.f * PI);
static const float ENCODER_TO_RADIAN_K = 2.f * PI / 8192.f;
#define ENCODER_TO_RADIAN(x)                        ((x) * ENCODER_TO_RADIAN_K)
#define RADIAN_TO_ENCODER(x)                        ((x) * RADIAN_TO_ENCODER_K)

// 小电脑状态结构体
typedef struct {
    uint16_t can_id;    //报头
    float speed_yaw;
    float speed_pitch;

    float angle_yaw;
    float angle_pitch;
}SMcomputer_InfoTypedef;

void NDJ6_Remote_Control(void);  //遥控器控制
void SMcomputer_Remote_Control(void);  //小电脑控制
void small_computer_connect_Init(void);     //初始化小电脑连接
void small_computer_connect_Receive(const uint8_t* rx_data); //接收小电脑数据
void small_computer_connect_Load(float data_yaw, float data_pitch); //装载小电脑发送数据内容
void small_computer_connect_Send(CAN_HandleTypeDef *hcan); //向小电脑发送数据

#endif //REMOTE_CRTL_H
